<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2021.3.22
 * Time: 10:10
 */

function odd($var) {

    return $var > 2;
}

$array = [
    'a' => 1,
    'b' => 2,
    'c' => 3
];

print_r(array_filter($array,'odd'));